export interface conSelectType {
  label: string;
  value: number;
  hidden?: boolean;
}
const formType = ref<Array<conSelectType>>([
  { label: '数据管理', value: 0 },
  { label: '单元管理', value: 1 },
  { label: '枚举管理', value: 2 },
  { label: '权限管理', value: 3 },
  { label: '功能sql管理', value: 4 },
]);

const formDataOrigin = ref<Array<conSelectType>>([{ label: '系统数据源', value: 0 }]);

const formData = reactive<Namespace.FormType>({
  loadKey: true,
  formFields: {
    regionName: '',
    regionCode: '',
    regionType: 0,
    originId: 0,
  },
  formRules: [
    [
      {
        title: '域名',
        required: true,
        field: 'regionName',
        placeholder: '请输入域名',
        type: 'text',
        colSize: 12,
      },
    ],
    [
      {
        title: '编号',
        required: true,
        field: 'regionCode',
        placeholder: '请输入编号',
        type: 'text',
        colSize: 12,
      },
    ],
    [
      {
        type: 'select',
        dataKey: 'value',
        dataName: 'label',
        default: '0',
        title: '类型',
        required: true,
        placeholder: '请选择类型',
        field: 'regionType',
        data: formType.value,
        readonly: false,
        colSize: 12,
      },
    ],
    [
      {
        type: 'select',
        dataKey: 'value',
        dataName: 'label',
        default: '0',
        title: '数据源',
        required: true,
        placeholder: '请选择数据源',
        field: 'originId',
        data: formDataOrigin.value,
        colSize: 12,
      },
    ],
  ],
});

export { formData };
